<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./jquery.js"></script>
  </head>
  <body>
    <button>start</button>
    <button>syop</button>
    <div
      style="
        background: #98bf21;
        height: 100px;
        width: 100px;
        position: absolute;
      "
    >
      你是猪吗？
    </div>
  </body>
  <script>
    $(function () {
      $('button:first').click(function () {
        $('div').animate(
          {
            left: '250px',
            top: '30px',
            fontSize: '32px',
            width: '300px',
            height: '300px',
          },
          3000,
          function () {
            alert('动画结束')
          }
        )
        $('div').animate(
          {
            left: '150px',
            top: '70px',
            fontSize: '22px',
            width: '200px',
            height: '200px',
          },
          5000
        )
      })
      $('button:last').click(function () {
        $('div').stop(true, true)
      })
    })
  </script>
</html>
